<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>桌面演练辅助应用系统登录</title>
<link href="__UI__/css/bs3/dpl-min.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/bs3/bui-min.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/login.css" rel="stylesheet" type="text/css"/>
<link href="__UI__/css/style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">

.main ul li {
	float:left;
	width:48%;
}

.main #verify {
	height:35px;
}

</style>
</head>

<body>
<div class="main">
	<div class="login-form">
    	<h1>桌面演练辅助应用系统</h1>
        <form id="J_Form" action="{:U('Public/checklogin')}" class="form-horizontal registerform" method="post" enctype="multipart/form-data">
        	<input type="text" name="username" id="username" class="input-large" datatype="*" nullmsg="请输入管理员名称！" ajaxurl="{:U('Public/checkname')}" sucmsg="" data-tip="{text:'请输入管理员名称'}" >
            <input type="password" name="password" id="password" class="input-large" datatype="*6-16" nullmsg="请输入管理员密码！" errormsg="密码范围在6~16位之间！" data-tip="{text:'请输入管理员密码'}">
            <ul>
            	<li style="margin-right:10px;"><input name="verify" type="text" id="verify" datatype="*" nullmsg="请输入验证码！" data-tip="{text:'请输入验证码'}" /></li>
                <li><img src="{:U('Public/verify')}" onclick="this.src=this.src+'?'+Math.random()" id="img" /></li>
            </ul>
            <ul style="float:left; margin:10px auto; height:30px; width:100%;">
            	<li><label><input type="checkbox" name="gid" value="1" />&nbsp;<span style="font-size:12px">管理员登录</span></label></li>
			</ul>
            <div class="submit">
            	<input type="submit" onclick="myFunction()" value="登录" >
			</div>
            <ul>
            	<li scctyle="margin-right:10px;"><span id="msgdemo2"></span></li>
            </ul>
        </form>
	</div>
</div>
<script type="text/javascript" src="__UI__/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="__UI__/js/bui-min.js"></script>
<script type="text/javascript" src="__UI__/js/config-min.js"></script>
<script type="text/javascript" src="__UI__/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	BUI.use('bui/form', function (Form) {
        new Form.Form({
            srcNode:'#J_Form'
        }).render();
    });

	$(function(){
		$(".registerform").Validform({
			tiptype:function(msg,o,cssctl){
				var objtip=$("#msgdemo2");
				cssctl(objtip,o.type);
				objtip.text(msg);
			},
			ajaxPost:true,
			callback:function(data){
				if(data.status == 's'){
					document.getElementById('img').src="{:U('Public/verify')}";
				}
				if(data.status == 'y'){
					window.location.href="{:U('Index/index')}";
				}
			},
		});
	})
</script>
</body>
</html>